<template>
	<div class="card m5 p10 flex_col">
		<label class="flex_center_self">抽水加热控制</label>
		<div class="flex_row mt5">
			<el-button @click="onClickDrawReset" type="primary">抽水重启</el-button>
			<el-button @click="onClickDrawStop" type="warning">抽水停止</el-button>
		</div>
		<div class="flex_row mt5">
			<el-button @click="onClickWaterReset" type="primary">瞬热器加热重启</el-button>
			<el-button @click="onClickWaterStop" type="warning">瞬热器加热停止</el-button>
		</div>
		<div class="flex_row mt5">
			<el-button @click="onClickSteamReset" type="primary">锅炉加热重启</el-button>
			<el-button @click="onClickSteamStop" type="warning">锅炉加热停止</el-button>
		</div>
	</div>
</template>

<script setup lang="ts">
import { runAction } from '../utils/ui';
import service from '../service/service';

async function onClickDrawReset() {
	await runAction('抽水', '重启', async () => {
		await service.drawHeatCtrl(0);
	});
}

async function onClickDrawStop() {
	await runAction('抽水', '停止', async () => {
		await service.drawHeatCtrl(1);
	});
}

async function onClickWaterReset() {
	await runAction('瞬热器加热', '重启', async () => {
		await service.drawHeatCtrl(2);
	});
}


async function onClickWaterStop() {
	await runAction('瞬热器加热', '停止', async () => {
		await service.drawHeatCtrl(3);
	});
}


async function onClickSteamReset() {
	await runAction('锅炉加热', '重启', async () => {
		await service.drawHeatCtrl(4);
	});
}


async function onClickSteamStop() {
	await runAction('锅炉加热', '停止', async () => {
		await service.drawHeatCtrl(5);
	});
}


</script>
